import { stringify } from "qs";
import request from "@/utils/request";

// 添加91灵工企业用户
export async function addZbCompanyUser(params) {
  return request.post(`/zb-company/add-zb-company-user`, params);
}

// 删除91灵工企业用户
export async function deleteZbCompanyUser(params) {
  return request.post(`/zb-company/delete-zb-company-user`, params, "form");
}

// 编辑91灵工企业用户
export async function editZbCompanyUser(params) {
  return request.post(`/zb-company/edit-zb-company-user`, params);
}

// 查询91灵工企业
export async function getListZbCompany() {
  return request(`/zb-company/list-zb-company`);
}

// 查询91灵工企业用户
export async function searchZbCompanyUser(params) {
  const { searchRequest, pagination } = params;
  return request.post(
    `/zb-company/search-zb-company-user?page=${pagination.page}&size=${pagination.size}`,
    searchRequest
  );
}

// 添加企业部门
export async function addCompanyDepartment(params) {
  return request.post(`/zb-company-department/add-company-department`, params);
}

// 编辑企业部门
export async function editCompanyDepartment(params) {
  return request.post(`/zb-company-department/edit-company-department`, params);
}

// 删除企业部门
export async function deleteCompanyDepartment(params) {
  return request.post(
    `/zb-company-department/delete-company-department`,
    params,
    "form"
  );
}

// 查询公司账户列表（带分页）
export async function searchCompanyAccountList(params) {
  return request(
    `/zb-company-account/search-company-account?${stringify(params)}`
  );
}

// 获取公司账户列表
export async function getCompanyAccountList(params) {
  return request(
    `/zb-company-account/list-company-account?${stringify(params)}`
  );
}

// 添加企业账户
export async function addCompanyAccount(params) {
  return request.post(`/zb-company-account/add-company-account`, params);
}

// 编辑企业账户
export async function editCompanyAccount(params) {
  return request.post(`/zb-company-account/edit-company-account`, params);
}

// 删除企业账户
export async function deleteCompanyAccount(params) {
  return request.post(
    `/zb-company-account/delete-company-account`,
    params,
    "form"
  );
}
